import 'package:flutter/material.dart';
import 'package:hkzf_flutter/widgets/information/index.dart';
import 'package:hkzf_flutter/pages/home/navigator/index_navigator.dart';
import 'package:hkzf_flutter/pages/home/recommend/index_recommend.dart';
import 'package:hkzf_flutter/widgets/common_swiper.dart';
import 'package:hkzf_flutter/widgets/search_bar/index.dart';

// 首页页面
class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: SearchBarWidget(
            showLocation: true,// 展示位置按钮
            showMap: true,// 展示地图按钮
            onSearch: () => {
              Navigator.pushNamed(context, '/search')
            },
            // goBackCallback:(){},
            // onCancel:(){},
          ),
          backgroundColor: Colors.white,
        ),
        body: Container(
          decoration: const BoxDecoration(
            color: Colors.white, // 设置背景颜色
          ),
          child: ListView(
            children:  [
              CommonSwiper(), 
              const IndexNavigator(),
              const IndexRecommend(),
              InformationPanel(showTitle: true,),

            ],
          ),
        )
    );
  }
}
